home *** CD-ROM | disk | FTP | other *** search
- Path: jth.ping.de!jth
- Date: 09 Apr 1996 14:20:00 +0100
- From: jth@jth.ping.de (Jens Theisen)
- Newsgroups: comp.lang.c++
- Message-ID: <66W1XonUoNB@jth.ping.de>
- References: <Andreas.Ernst-0704960918430001@grumari.bonn.netsurf.de>
- Subject: Re: fastest way to detect int overflow
- X-Newsreader: CrossPoint v3.1
-
- Andreas.Ernst@bonn.netsurf.de wrote:
- > What is the fastest way to detect arithmetic operations causing an overflow?
- > It works by doing some arithmetic with MAX/MIN_<...>, but this seems way
- > too slow to me. Isn't there a better way ( like checking the carry bit in
- > a portable way???).
- >
- > Thanks, Andreas
- >
- > --
- > still under construction
-
- If you mean with "portable way" that you want to have a real C++ -
- solution, I can't help you. Otherwise, if you are programming on PCs, try
- Inline-Assembler. The 80x86 have a special carry-flag for ints, the
- overflow-flag.
- Jens Theisen
-
-